# # 
#  Auth.py
#  ExpectIT
#  
#  Author: Marvin S. Addison
#  Date: 2007-10-15
#  Version: $Revision: $
#  Updated: $Date: $
#  Copyright 2008 Marvin S. Addison. All rights reserved.
#  See LICENSE.txt for licensing information.
#

import util

class AuthData:
	"""Represents host authentication data where the credential can be either
	a password or private key."""
	
	def __init__(self):
		"""Initializes an AuthData object with the default authentication
		method (password) and empty credentials."""
		self.method = 'password'
		self.user = ''
		self.credential = ''


def from_dict(dict):
	"""Creates a new AuthData object initialized with properties from the
	supplied dictionary."""
	auth = AuthData()
	util.load_object(auth, dict)
	return auth
